package com.easyjob;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableAsync
@SpringBootApplication(scanBasePackages = {"com.easyjob"})
@MapperScan(basePackages = {"com.easyjob.mappers"})
@EnableTransactionManagement
@EnableScheduling
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 2400, redisNamespace = "easyjob:session")
public class EasyjobAdminApplication {
    private static final Logger logger = LoggerFactory.getLogger(EasyjobAdminApplication.class);

    public static void main(String[] args) {
        try {
            SpringApplication.run(EasyjobAdminApplication.class);
        } catch (Exception e) {
            if (e.getLocalizedMessage().contains("RedisConnectionException")) {
                logger.error("redi配置错误，请仔细检查redis配置");
            }
        }
    }
}
